You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TMtx Class > TMtx Methods > TMtx.PixelDownSample Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TMtx.PixelDownSample Method

Creates a reduced size dense matrix for screen display (bitmap) to show the matrix pattern.

Syntax
C#
Visual Basic
public void PixelDownSample([In] TMtx Dst, int Pixels, TPixelDownSample Mode);

Creates a reduced size dense matrix for screen display (bitmap) to show the matrix pattern. Pixels parameter defines the target number of pixels to reduce Rows and Cols to. The size reduction method depends on what you want to see:

  • pdsPattern , Returns 1 for all areas with at least one nonzero value regardless of its amplitude.
  • pdsAverage, Average all values within an area (pixel).
  • pdsPeak, Return only the maximum absolute value within an area (region will become one pixel).
Uses ..., MtxVecTee; var Mtx, ReducedMtx: TMtx; begin CreateIt(Mtx,ReducedMtx); try Mtx.Size(1000,1000,false); Mtx.RandGauss; // we're interested in averages, not pattern Mtx.PixelDownSample(ReducedMtx,200,pdsAverage); DrawIt(ReducedMtx); finally FreeIt(Mtx,ReducedMtx); end; end;

7

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!